package com.kuqi.dao;

import com.kuqi.entity.BannerInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface BannerRepository extends JpaRepository<BannerInfo, Integer> {

    // 根据未成年分类来查询轮播图数据(单次只展现5张)
    @Query(value = "select * from banner where  is_child =  ?1 limit ?2",nativeQuery = true)
    List<BannerInfo> findByIsChild(int isChild, int limit);

}